<template>
	<view class="page-e tn-safe-area-inset-bottom" style="height: 100%;overflow-y: scroll;background-color: #ffffff;">
		<!-- 顶部自定义导航 -->
		<tn-nav-bar :isBack="false" :bottomShadow="false" backgroundColor="none">
			<view class="custom-nav tn-flex tn-flex-col-center tn-flex-row-left">
				<view class="custom-nav__back">
					<view class="tn-icon-flower-fill tn-color-gray" style="font-size: 50rpx;color: #F1C68E !important;">
					</view>
				</view>
			</view>
		</tn-nav-bar>

		<view class="top-backgroup">
			<!-- <image src='https://imgcdn.tutudati.com/guide-bg.jpg' mode='widthFix' class='backgroud-image'></image> -->
		</view>

		<view class="tn-margin-left tn-margin-right" :style="{paddingTop: vuex_custom_bar_height + 'px'}">
			<!-- 图标logo/头像 -->
			<view class="tn-flex tn-flex-row-between tn-flex-col-center tn-margin-bottom" style="margin-top: -450rpx;">
				<!-- 已登录时 -->
				<block v-if="loginStatus == 1">
					<view class="justify-content-item">
						<view class="tn-flex tn-flex-col-center tn-flex-row-left">
							<view class="logo-pic tn-shadow" @click="goAboutMe">
								<view class="logo-image">
									<view class="tn-shadow-blur"
										style="width: 110rpx;height: 110rpx;background-size: cover;overflow: hidden;"
										:style="{ backgroundImage: `url(${ userinfo.profile_picture ? baseUrl + userinfo.profile_picture : '/static/mine/avatar.gif' })` }">
									</view>
								</view>
							</view>
							<view class="tn-padding-right" @click="copyWeChat">
								<view class="tn-padding-right tn-padding-left-sm">
									<text
										class="tn-color-wallpaper tn-text-xl tn-text-bold">{{ userinfo.full_name }}</text>
									<text class=" tn-round tn-text-xs tn-bg-red tn-color-white tn-margin-left-sm"
										style="padding: 10rpx 20rpx;">
										已认证
									</text>
								</view>
								<view class="tn-padding-right tn-padding-top-xs tn-padding-left-sm tn-text-ellipsis"
									@click="copyWeChat">
									<text class="tn-color-gray">邀请码: 1405936</text>
									<text
										class="tn-color-blue--disabled tn-padding-left-xs tn-text-sm tn-icon-copy"></text>
								</view>
							</view>

						</view>
					</view>
					<view class="justify-content-item" @click="goSysSetting">
						<view class="tn-icon-install tn-color-gray" style="font-size: 50rpx;opacity: 0.5;">
						</view>
					</view>
				</block>
			</view>

			<!-- 没有授权，则显示这个授权按钮-->
			<block v-if="loginStatus == 2">
				<view class="tn-flex tn-flex-row-between">
					<view class="tn-flex-1 justify-content-item tn-margin-xs tn-text-center" @click="goLogin">
						<tn-button shape="round" backgroundColor="#1D2541" fontColor="#ffffff" padding="20rpx 0"
							width="40%" shadow>
							<text class="tn-icon-wechat tn-padding-right-xs tn-text-xl"></text>
							<text class="">授权登录</text>
						</tn-button>
					</view>
				</view>
			</block>

			<view class="wallpaper-shadow tn-margin-top-lg tn-padding-top-sm tn-padding-bottom-sm tn-bg-white">
				<view class="tn-flex tn-flex-row-center tn-radius tn-padding-top">
					<view class="tn-padding-sm tn-margin-xs tn-radius" @click="goBillA">
						<view class="tn-flex tn-flex-direction-column tn-flex-row-center tn-flex-col-center">
							<view
								class="icon12__item--icon tn-flex tn-flex-row-center tn-flex-col-center tn-bg-blue--light">
								<view class="tn-color-wallpaper">{{ cash }}</view>
							</view>
							<view class="tn-text-center">
								<text class="tn-text-ellipsis">现金余额</text>
							</view>
						</view>
					</view>
					<view class="tn-padding-sm tn-margin-xs tn-radius" @click="goBillB">
						<view class="tn-flex tn-flex-direction-column tn-flex-row-center tn-flex-col-center">
							<view
								class="icon12__item--icon tn-flex tn-flex-row-center tn-flex-col-center tn-bg-blue--light">
								<view class="tn-color-wallpaper">{{ gold }}</view>
							</view>
							<view class="tn-text-center">
								<text class="tn-text-ellipsis">金币余额</text>
							</view>
						</view>
					</view>
					<view class="tn-padding-sm tn-margin-xs tn-radius" @click="open">
						<view class="tn-flex tn-flex-direction-column tn-flex-row-center tn-flex-col-center">
							<view
								class="icon12__item--icon tn-flex tn-flex-row-center tn-flex-col-center tn-bg-blue--light">
								<view class="tn-icon-pay tn-color-wallpaper"></view>
							</view>
							<view class="tn-text-center">
								<text class="tn-text-ellipsis">金币兑换</text>
							</view>
						</view>
					</view>
					<view class="tn-padding-sm tn-margin-xs tn-radius" @click="goCash">
						<view class="tn-flex tn-flex-direction-column tn-flex-row-center tn-flex-col-center">
							<view
								class="icon12__item--icon tn-flex tn-flex-row-center tn-flex-col-center tn-bg-blue--light">
								<view class="tn-icon-bankcard tn-color-wallpaper"></view>
							</view>
							<view class="tn-text-center">
								<text class="tn-text-ellipsis">我要提现</text>
							</view>
						</view>
					</view>
				</view>
			</view>

			<view class="tn-margin-top-xl">
				<view class="button-number tn-flex tn-flex-row-between tn-flex-col-center tn-shadow-blur"
					style="background: linear-gradient(-120deg, #3E445A, #31374A, #2B3042, #262B3C);">
					<view class="tn-margin-left">
						<view class="tn-flex tn-flex-col-center" style="color: #F1C68E;margin-top: -20rpx;">
							<text class="tn-text-bold tn-text-xl">Passion</text>
						</view>
						<view class='tn-color-white tn-text-sm'>好好学习，天天向上！</view>
					</view>
					<view class="tn-margin-right">
						<tn-button shape="round" backgroundColor="#F1C68E" fontColor="#634738" padding="10rpx 0"
							width="160rpx" shadow>
							<text class="tn-icon-vip tn-padding-right-sm tn-text-lg"></text>
							<text class="tn-text-bold">answer</text>
						</tn-button>
					</view>

					<!-- 					<view class="tnwave waveAnimation">
						<view class="waveWrapperInner bgTop">
							<view class="wave waveTop"
								style="background-image: url('https://imgcdn.tutudati.com/guide-bg3.jpg')"></view>
						</view>
						<view class="waveWrapperInner bgMiddle">
							<view class="wave waveMiddle"
								style="background-image: url('https://imgcdn.tutudati.com/guide-bg2.jpg')"></view>
						</view>
						<view class="waveWrapperInner bgBottom">
							<view class="wave waveBottom"
								style="background-image: url('https://imgcdn.tutudati.com/guide-bg3.jpg')"></view>
						</view>
					</view> -->

				</view>
			</view>

			<!-- 信息流广告开始 -->
			<!-- 			<view class="" v-if="showAd">
				<view class="ad-view">
					<ad adpid="1360526308" @load="onloaded" @close="onclosed" @error="onerror"></ad>
				</view>
			</view> -->
			<!-- 信息流广告结束 -->

			<!-- 方式5 start-->
			<!-- 			<view class="tn-flex">
				<view class="tn-flex-1 wallpaper-shadow tn-bg-white" style="margin: 50rpx 15rpx 0 0;padding: 30rpx 0;"
					@click="goForm">
					<view class="tn-flex tn-flex-direction-column tn-flex-row-center tn-flex-col-center">
						<view class="icon5__item--icon tn-flex tn-flex-row-center tn-flex-col-center"
							style="background-image:url('https://cdn.nlark.com/yuque/0/2022/png/280373/1666764808285-assets/web-upload/b83d1b36-7355-4f36-bc02-9f06b8c0867c.png');background-size:100% 100%;background-size: cover;">
						</view>
						<view class="tn-text-center" style="font-size: 30rpx;">
							<view class="tn-text-ellipsis">发布信息</view>
						</view>
					</view>
				</view>
				<view class="tn-flex-1 wallpaper-shadow tn-bg-white" style="margin: 50rpx 0 0 15rpx;padding: 30rpx 0;"
					@click="goDiscover">
					<view class="tn-flex tn-flex-direction-column tn-flex-row-center tn-flex-col-center">
						<view class="icon5__item--icon tn-flex tn-flex-row-center tn-flex-col-center"
							style="background-image:url('https://cdn.nlark.com/yuque/0/2022/png/280373/1666764788528-assets/web-upload/955b13dd-7715-4627-b8cc-04ae3d85051a.png');background-size:100% 100%;background-size: cover;">
						</view>
						<view class="tn-text-center" style="font-size: 30rpx;">
							<view class="tn-text-ellipsis">壁纸首页</view>
						</view>
					</view>
				</view>
			</view> -->

			<!-- 更多信息-->
			<!-- 方式12 start-->
			<view class="wallpaper-shadow tn-margin-top-lg tn-padding-top-sm tn-padding-bottom-sm tn-bg-white">
				<view class="tn-flex tn-flex-row-center tn-radius tn-padding-top">
					<view class="tn-padding-sm tn-margin-xs tn-radius" @click="goBillB">
						<view class="tn-flex tn-flex-direction-column tn-flex-row-center tn-flex-col-center">
							<view
								class="icon12__item--icon tn-flex tn-flex-row-center tn-flex-col-center tn-bg-blue--light">
								<view class="tn-icon-money tn-color-wallpaper"></view>
							</view>
							<view class="tn-text-center">
								<text class="tn-text-ellipsis">收支记录</text>
							</view>
						</view>
					</view>
					<view class="tn-padding-sm tn-margin-xs tn-radius" @click="goWithoutHistory">
						<view class="tn-flex tn-flex-direction-column tn-flex-row-center tn-flex-col-center">
							<view
								class="icon12__item--icon tn-flex tn-flex-row-center tn-flex-col-center tn-bg-blue--light">
								<view class="tn-icon-lucky-money tn-color-wallpaper"></view>
							</view>
							<view class="tn-text-center">
								<text class="tn-text-ellipsis">提现记录</text>
							</view>
						</view>
					</view>
					<view class="tn-padding-sm tn-margin-xs tn-radius" @click="goExamHistory">
						<view class="tn-flex tn-flex-direction-column tn-flex-row-center tn-flex-col-center">
							<view
								class="icon12__item--icon tn-flex tn-flex-row-center tn-flex-col-center tn-bg-blue--light">
								<view class="tn-icon-order tn-color-wallpaper"></view>
							</view>
							<view class="tn-text-center">
								<text class="tn-text-ellipsis">答题记录</text>
							</view>
						</view>
					</view>
					<view class="tn-padding-sm tn-margin-xs tn-radius" @click="goCustomerService">
						<view class="tn-flex tn-flex-direction-column tn-flex-row-center tn-flex-col-center">
							<view
								class="icon12__item--icon tn-flex tn-flex-row-center tn-flex-col-center tn-bg-blue--light">
								<view class="tn-icon-wechat tn-color-wallpaper"></view>
							</view>
							<view class="tn-text-center">
								<text class="tn-text-ellipsis">沟通交流</text>
							</view>
						</view>
					</view>
				</view>
			</view>
			<!-- 更多信息-->
			<view class="wallpaper-shadow tn-margin-top-lg tn-padding-top-sm tn-padding-bottom-sm">
				<tn-list-cell :hover="true" :unlined="true" :radius="true" :fontSize="30" @click="goCustomerService">
					<view class="tn-flex tn-flex-col-center">
						<view class="icon1__item--icon tn-flex tn-flex-row-center tn-flex-col-center"
							style="color: #7C8191;">
							<view class="tn-icon-headset"></view>
						</view>
						<view class="tn-margin-left-sm tn-flex-1">联系客服</view>
						<view class="tn-color-gray tn-icon-right"></view>
					</view>
				</tn-list-cell>
				<!-- 				<tn-list-cell :hover="true" :unlined="true" :radius="true" :fontSize="30" @click="goMessage">
					<view class="tn-flex tn-flex-col-center">
						<view class="icon1__item--icon tn-flex tn-flex-row-center tn-flex-col-center"
							style="color: #7C8191;">
							<view class="tn-icon-comment"></view>
						</view>
						<view class="tn-margin-left-sm tn-flex-1">我的消息</view>
						<view class="tn-color-gray tn-icon-right"></view>
					</view>
				</tn-list-cell> -->
				<tn-list-cell :hover="true" :unlined="true" :radius="true" :fontSize="30">
					<button class="tn-flex tn-flex-col-center tn-button--clear-style" open-type="feedback">
						<view class="icon1__item--icon tn-flex tn-flex-row-center tn-flex-col-center"
							style="color: #7C8191;">
							<view class="tn-icon-tip-fill"></view>
						</view>
						<view class="tn-flex tn-flex-row-between" style="width: 100%;">
							<view class="tn-margin-left-sm">问题反馈</view>
							<view class="tn-color-gray tn-icon-right"></view>
						</view>
					</button>
				</tn-list-cell>
				<!-- 				<tn-list-cell :hover="true" :unlined="true" :radius="true" :fontSize="30" @click="navAddress">
					<view class="tn-flex tn-flex-col-center">
						<view class="icon1__item--icon tn-flex tn-flex-row-center tn-flex-col-center"
							style="color: #7C8191;">
							<view class="tn-icon-message-fill"></view>
						</view>
						<view class="tn-flex tn-flex-row-between" style="width: 100%;">
							<view class="tn-margin-left-sm">收货地址</view>
							<view class="tn-color-gray tn-icon-right"></view>
						</view>
					</view>
				</tn-list-cell> -->
				<!-- 				<tn-list-cell :hover="true" :unlined="true" :radius="true" :fontSize="30" @click="goNav">
					<view class="tn-flex tn-flex-col-center">
						<view class="icon1__item--icon tn-flex tn-flex-row-center tn-flex-col-center"
							style="color: #7C8191;">
							<view class="tn-icon-bookmark-fill"></view>
						</view>
						<view class="tn-margin-left-sm tn-flex-1">导航教程</view>
						<view class="tn-color-gray tn-icon-right"></view>
					</view>
				</tn-list-cell> -->
				<!-- 				<tn-list-cell :hover="true" :unlined="true" :radius="true" :fontSize="30" @click="goCash">
					<view class="tn-flex tn-flex-col-center">
						<view class="icon1__item--icon tn-flex tn-flex-row-center tn-flex-col-center"
							style="color: #7C8191;">
							<view class="tn-icon-bookmark-fill"></view>
						</view>
						<view class="tn-margin-left-sm tn-flex-1">提现页面</view>
						<view class="tn-color-gray tn-icon-right"></view>
					</view>
				</tn-list-cell> -->
				<!-- 				<tn-list-cell :hover="true" :unlined="true" :radius="true" :fontSize="30" @click="goLodash">
					<view class="tn-flex tn-flex-col-center">
						<view class="icon1__item--icon tn-flex tn-flex-row-center tn-flex-col-center"
							style="color: #7C8191;">
							<view class="tn-icon-message-fill"></view>
						</view>
						<view class="tn-flex tn-flex-row-between" style="width: 100%;">
							<view class="tn-margin-left-sm">Lodash</view>
							<view class="tn-color-gray tn-icon-right"></view>
						</view>
					</view>
				</tn-list-cell> -->

			</view>
			<view class="wallpaper-shadow tn-margin-top-lg tn-margin-bottom-lg tn-padding-top-sm tn-padding-bottom-sm">
				<!-- 				<tn-list-cell :hover="true" :unlined="true" :radius="true" :fontSize="30" @click="goEvaluate">
					<button class="tn-flex tn-flex-col-center tn-button--clear-style">
						<view class="icon1__item--icon tn-flex tn-flex-row-center tn-flex-col-center"
							style="color: #7C8191;">
							<view class="tn-icon-flower"></view>
						</view>
						<view class="tn-flex tn-flex-row-between" style="width: 100%;">
							<view class="tn-margin-left-sm">给我评价</view>
							<view class="tn-color-gray tn-icon-right"></view>
						</view>
					</button>
				</tn-list-cell> -->
				<!-- 				<tn-list-cell :hover="true" :unlined="true" :radius="true" :fontSize="30" @click="goUpdate">
					<button class="tn-flex tn-flex-col-center tn-button--clear-style">
						<view class="icon1__item--icon tn-flex tn-flex-row-center tn-flex-col-center"
							style="color: #7C8191;">
							<view class="tn-icon-commissary"></view>
						</view>
						<view class="tn-flex tn-flex-row-between" style="width: 100%;">
							<view class="tn-margin-left-sm">绑定邀请码</view>
							<view class="tn-color-gray tn-icon-right"></view>
						</view>
					</button>
				</tn-list-cell> -->
				<tn-list-cell :hover="true" :unlined="true" :radius="true" :fontSize="30" @click="goServiceAgreement">
					<button class="tn-flex tn-flex-col-center tn-button--clear-style">
						<view class="icon1__item--icon tn-flex tn-flex-row-center tn-flex-col-center"
							style="color: #7C8191;">
							<view class="tn-icon-inventory"></view>
						</view>
						<view class="tn-flex tn-flex-row-between" style="width: 100%;">
							<view class="tn-margin-left-sm">服务协议</view>
							<view class="tn-color-gray tn-icon-right"></view>
						</view>
					</button>
				</tn-list-cell>
				<tn-list-cell :hover="true" :unlined="true" :radius="true" :fontSize="30" @click="goPrivacy">
					<button class="tn-flex tn-flex-col-center tn-button--clear-style">
						<view class="icon1__item--icon tn-flex tn-flex-row-center tn-flex-col-center"
							style="color: #7C8191;">
							<view class="tn-icon-safe"></view>
						</view>
						<view class="tn-flex tn-flex-row-between" style="width: 100%;">
							<view class="tn-margin-left-sm">隐私政策</view>
							<view class="tn-color-gray tn-icon-right"></view>
						</view>
					</button>
				</tn-list-cell>
				<tn-list-cell :hover="true" :unlined="true" :radius="true" :fontSize="30" @click="goUpdate">
					<button class="tn-flex tn-flex-col-center tn-button--clear-style">
						<view class="icon1__item--icon tn-flex tn-flex-row-center tn-flex-col-center"
							style="color: #7C8191;">
							<view class="tn-icon-warning"></view>
						</view>
						<view class="tn-flex tn-flex-row-between" style="width: 100%;">
							<view class="tn-margin-left-sm">版本更新</view>
							<view class="tn-color-gray tn-icon-right"></view>
						</view>
					</button>
				</tn-list-cell>
				<tn-list-cell :hover="true" :unlined="true" :radius="true" :fontSize="30" @click="loginOut">
					<view class="tn-flex tn-flex-col-center">
						<view class="icon1__item--icon tn-flex tn-flex-row-center tn-flex-col-center"
							style="color: #7C8191;">
							<view class="tn-icon-my-simple-fill"></view>
						</view>
						<view class="tn-flex tn-flex-row-between" style="width: 100%;">
							<view class="tn-margin-left-sm tn-flex-1">退出登录</view>
							<view class="tn-color-gray tn-icon-right"></view>
						</view>
					</view>
				</tn-list-cell>
				<!-- 				<tn-list-cell :hover="true" :unlined="true" :radius="false" :fontSize="30" @click="callPhoneNumber"
					data-number="18266666666">
					<view class="tn-flex tn-flex-col-center">
						<view class="icon1__item--icon tn-flex tn-flex-row-center tn-flex-col-center"
							style="color: #7C8191;">
							<view class="tn-icon-tel-circle-fill"></view>
						</view>
						<view class="tn-margin-left-sm tn-flex-1">技术热线</view>
						<view
							class="tn-margin-left-sm tn-color-wallpaper tn-text-sm tn-padding-left-xs tn-padding-right-xs tn-bg-gray--light tn-round">
							177****1107</view>
					</view>
				</tn-list-cell> -->

			</view>
		</view>

		<tn-modal v-model="show" :title="title" :content="content" :button="button" @click="onOk"></tn-modal>

	</view>
</template>

<script>
	import {
		getFinancialInfo,
		getUserInfo
	} from "@/apis/user.js";
	import {
		exchangePoints,
		withdrawApply
	} from "@/apis/cash.js"
	import {
		getToken,
		setToken,
		removeToken,
		removeRefreshToken
	} from '@/utils/auth';
	import config from '@/config/config.js'

	export default {
		data() {
			return {
				showAd: getApp().globalData.showAd,
				userinfo: {
					full_name: '',
					profile_picture: '',
					phone_number: '',
					wechat_account: '',
					alipay_account: '',
					real_name: '',
				},
				loginStatus: 2, // 1登录2未登录
				cash: 0,
				gold: 0,
				power: 100,
				baseUrl: '',
				show: false,
				title: '提示',
				content: '确定兑换金币',
				button: [{
						text: '取消',
						backgroundColor: '#E6E6E6',
						fontColor: '#FFFFFF'
					},
					{
						text: '确定',
						backgroundColor: 'tn-bg-indigo',
						fontColor: '#FFFFFF'
					}
				]
			}
		},
		onShow() {
			this.baseUrl = config.baseUrl
			this.getUserAvatarInfo()
			this.getUserInfo()
		},
		methods: {
			// 信息流的广告
			onloaded(e) {
				console.log("信息流广告onload");
			},
			onclosed(e) {
				console.log("信息流广告onclose: " + e.detail);
			},
			onerror(e) {
				console.log("信息流广告onerror: " + e.detail.errCode + " message:: " + e.detail.errMsg);
			},
			getUserInfo() {
				getUserInfo().then(res => {
					this.userinfo = res.user;
					this.gold = res.points;
					this.cash = res.cash;
					uni.setStorageSync('userInfo', this.userinfo)
				})
			},
			getUserAvatarInfo() {
				// getUserBasicInfoNoAuth().then(res => {
				// 	res.code === 103 ? this.loginStatus = 2 : this.loginStatus = 1
				// 	this.userInfo = res.data
				// })
				getToken() === "" ? this.loginStatus = 2 : this.loginStatus = 1
			},
			getFinancialInfo() {
				getFinancialInfo().then(res => {
					this.gold = res.points;
					this.cash = res.cash;
				})
			},
			open() {
				this.show = true;
			},
			onOk(option) {
				this.show = false;
				if (option.index == 1) {
					this.transformCash();
				}
			},
			transformCash() {
				exchangePoints().then(res => {
					this.gold = res.points;
					this.cash = res.cash;
				})
			},
			goBillA() {
				uni.navigateTo({
					url: "/pagesMine/bill/bill?billType=cash"
				})
			},
			goBillB() {
				uni.navigateTo({
					url: "/pagesMine/bill/bill?billType=gold"
				})
			},
			goExamHistory() {
				uni.navigateTo({
					url: "/pagesExam/answerHistory/answerHistory"
				})
			},
			// 系统设置
			goSysSetting() {
				uni.navigateTo({
					url: "/pagesMine/userinfo/userinfo"
				})
			},
			// 客服
			goCustomerService() {
				uni.navigateTo({
					url: "/pagesMine/customer/customer"
				})
			},
			goPrivacy() {
				uni.navigateTo({
					url: "/pagesMine/privacy/privacy"
				})
			},
			goServiceAgreement() {
				uni.navigateTo({
					url: "/pagesMine/serviceAgreement/serviceAgreement"
				})
			},
			// 我的消息
			goMessage() {
				this.tool.toastTip("功能正在完善中...", 'none', 1000)
			},
			// 评价
			goEvaluate() {
				this.tool.toastTip("功能正在完善中...", 'none', 1000)
			},
			// 检查更新
			checkUpdate() {
				uni.request({
					url: this.baseUrl + '/api/versions/latest',
					success: (res) => {
						if (res.statusCode === 200) {
							const latestVersion = res.data.version_code
							const currentVersion = config.appInfo.version

							// 使用uni-app提供的版本比较方法
							if (this.tool.compareVersions(latestVersion, currentVersion) > 0) {
								uni.showModal({
									title: '发现新版本',
									content: '是否立即更新？',
									success: (modalRes) => {
										if (modalRes.confirm && res.data.download_url) {
											this.downloadUpdate(res.data.download_url)
										}
									}
								})
							} else {
								uni.showToast({
									title: '当前已是最新版本',
									icon: 'none'
								})
							}
						}
					},
					fail: (err) => {
						console.error('检查更新失败:', err)
						uni.showToast({
							title: '检查更新失败',
							icon: 'none'
						})
					}
				})
			},
			// 下载更新包
			downloadUpdate(url) {
				uni.showLoading({
					title: '下载中...',
					mask: true
				})

				uni.downloadFile({
					url: url,
					success: (downloadResult) => {
						console.log(downloadResult)
						uni.hideLoading()
						if (downloadResult.statusCode === 200) {
							plus.runtime.install(
								downloadResult.tempFilePath, {
									force: true
								},
								() => {
									uni.showToast({
										title: '安装成功'
									})
									// 安装完成后可能需要重启应用
									setTimeout(() => {
										plus.runtime.restart()
									}, 1500)
								},
								(error) => {
									console.error('安装失败:', error)
									uni.showToast({
										title: '安装失败',
										icon: 'none'
									})
								}
							)
						}
					},
					fail: (err) => {
						uni.hideLoading()
						console.error('下载失败:', err)
						uni.showToast({
							title: '下载失败',
							icon: 'none'
						})
					}
				})
			},
			// 更新
			goUpdate() {
				this.checkUpdate();
			},
			// 收货地址
			navAddress() {
				uni.chooseAddress({})
			},
			// 单纯短震动
			short() {
				wx.vibrateShort();
			},
			// 提现模板
			goCash() {
				uni.navigateTo({
					url: '/pagesMine/cashOut/cashOut'
				})
			},
			// 提现记录
			goWithoutHistory() {
				uni.navigateTo({
					url: '/pagesMine/cashoutHistory/cashoutHistory'
				})
			},
			// lodash
			goLodash() {
				uni.navigateTo({
					url: "/pagesMine/lodash/lodash"
				})
			},
			// 壁纸首页
			goDiscover() {
				uni.navigateTo({
					url: '/pagesMine/discovery/discovery'
				})
			},
			// 关于作者
			goAboutMe() {
				return;
				uni.navigateTo({
					url: '/pagesMine/me/me'
				})
			},
			// 自定义导航栏教程
			goNav() {
				uni.navigateTo({
					url: '/pagesMine/navSearch/navSearch'
				})
			},
			// 刷新记录模板
			goRecords() {
				return;
				uni.navigateTo({
					url: '/pagesMine/records/records'
				})
			},
			// FLex完美布局
			goFlex() {
				uni.navigateTo({
					url: '/pagesMine/flex/flex'
				})
			},
			// 简约登录
			goLogin() {
				uni.navigateTo({
					url: '/pagesExam/login/login'
				})
			},
			// 普通登录
			goLoginS() {
				uni.navigateTo({
					url: '/pagesExam/login/login'
				})
			},
			// 订单列表模板
			goOrder() {
				uni.navigateTo({
					url: '/pagesMine/order/order'
				})
			},
			// 表单编辑
			goForm() {
				uni.navigateTo({
					url: '/pagesMine/form/form'
				})
			},
			//拨打固定电话
			callPhoneNumber() {
				uni.makePhoneCall({
					phoneNumber: "17738531107",
				});
			},
			// 复制微信
			copyWeChat() {
				this.tool.toastTip("您的邀请码已复制到剪切板", 'none', 1000)
				// wx.vibrateShort();
				uni.setClipboardData({
					data: "alice_xiwangzi",
				})
			},
			// 退出登录
			loginOut() {
				// uni.clearStorageSync("login")
				uni.showModal({
					title: '退出登录',
					content: '确定要退出登录吗',
					success: (modalRes) => {
						if (modalRes.confirm) {
							removeToken()
							removeRefreshToken()
							this.$func.showToast("退出成功")
							this.loginStatus = 2
						}
					}
				})
			}
		}
	}
</script>

<style lang="scss" scoped>
	.page-e {
		max-height: 100vh;
	}

	/* 底部安全边距 start*/
	.tn-tabbar-height {
		min-height: 120rpx;
		height: calc(140rpx + env(safe-area-inset-bottom) / 2);
		height: calc(140rpx + constant(safe-area-inset-bottom));
	}

	.tn-color-wallpaper {
		color: #1D2541;
		font-size: 40rpx;
	}

	/* 自定义导航栏内容 start */
	.custom-nav {
		height: 100%;

		&__back {
			margin: auto 5rpx;
			font-size: 40rpx;
			margin-right: 10rpx;
			flex-basis: 5%;
			width: 100rpx;
			position: absolute;
		}
	}

	/* 自定义导航栏内容 end */
	/* 顶部背景图 start */
	.top-backgroup {
		height: 450rpx;
		z-index: -1;

		.backgroud-image {
			width: 100%;
			height: 450rpx;
			// z-index: -1;
		}
	}

	/* 顶部背景图 end */
	/* 图标容器5 start */
	.icon5 {
		&__item {
			// width: 30%;
			background-color: #FFFFFF;
			border-radius: 10rpx;
			padding: 0rpx;
			margin: 0rpx;
			transform: scale(1);
			transition: transform 0.3s linear;
			transform-origin: center center;

			&--icon {
				width: 96rpx;
				height: 96rpx;
				border-radius: 50%;
				margin-bottom: 18rpx;
				position: relative;
				z-index: 1;
			}
		}
	}

	/* 用户头像 start */
	.logo-image {
		width: 110rpx;
		height: 110rpx;
		position: relative;
		overflow: hidden;
		border-radius: 50%;
	}

	.logo-pic {
		background-size: cover;
		background-repeat: no-repeat;
		// background-attachment:fixed;
		background-position: top;
		border: 8rpx solid rgba(255, 255, 255, 0.05);
		box-shadow: 0rpx 0rpx 80rpx 0rpx rgba(0, 0, 0, 0.15);
		border-radius: 50%;
		overflow: hidden;
		// background-color: #FFFFFF;
	}

	/* 页面阴影 start*/
	.wallpaper-shadow {
		border-radius: 15rpx;
		box-shadow: 0rpx 0rpx 50rpx 0rpx rgba(0, 0, 0, 0.07);
	}

	/* 页面阴影 end*/
	/* 图标容器15 start */
	.icon15 {
		&__item {
			width: 30%;
			background-color: #FFFFFF;
			border-radius: 10rpx;
			padding: 30rpx;
			margin: 20rpx 10rpx;
			transform: scale(1);
			transition: transform 0.3s linear;
			transform-origin: center center;

			&--icon {
				width: 100rpx;
				height: 100rpx;
				font-size: 60rpx;
				border-radius: 50%;
				margin-bottom: 18rpx;
				position: relative;
				z-index: 1;

				&::after {
					content: " ";
					position: absolute;
					z-index: -1;
					width: 100%;
					height: 100%;
					left: 0;
					bottom: 0;
					border-radius: inherit;
					opacity: 1;
					transform: scale(1, 1);
					background-size: 100% 100%;
				}
			}
		}
	}

	/* 图标容器12 start */
	.icon12 {
		&__item {
			width: 30%;
			background-color: #FFFFFF;
			border-radius: 10rpx;
			padding: 30rpx;
			margin: 20rpx 10rpx;
			transform: scale(1);
			transition: transform 0.3s linear;
			transform-origin: center center;

			&--icon {
				width: 15rpx;
				height: 15rpx;
				font-size: 50rpx;
				border-radius: 50%;
				margin-bottom: 38rpx;
				position: relative;
				z-index: 1;

				&::after {
					content: " ";
					position: absolute;
					z-index: -1;
					width: 100%;
					height: 100%;
					left: 0;
					bottom: 0;
					border-radius: inherit;
					opacity: 1;
					transform: scale(1, 1);
					background-size: 100% 100%;
				}
			}
		}
	}

	/* 图标容器1 start */
	.icon1 {
		&__item {
			// width: 30%;
			background-color: #FFFFFF;
			border-radius: 10rpx;
			padding: 30rpx;
			margin: 20rpx 10rpx;
			transform: scale(1);
			transition: transform 0.3s linear;
			transform-origin: center center;

			&--icon {
				width: 40rpx;
				height: 40rpx;
				font-size: 40rpx;
				border-radius: 50%;
				position: relative;
				z-index: 1;

				&::after {
					content: " ";
					position: absolute;
					z-index: -1;
					width: 100%;
					height: 100%;
					left: 0;
					bottom: 0;
					border-radius: inherit;
					opacity: 1;
					transform: scale(1, 1);
					background-size: 100% 100%;
					// background-image: url(https://imgcdn.tutudati.com/guide-bg3.jpg);
				}
			}
		}
	}

	/* 图标容器1 end */
	.button-shake {
		animation: shake 4s infinite;
	}

	@keyframes shake {

		5%,
		50% {
			transform: scale(1);
		}

		10% {
			transform: scale(0.9);
		}

		15% {
			transform: scale(1.15);
		}

		20% {
			transform: scale(1.15) rotate(-5deg);
		}

		25% {
			transform: scale(1.15) rotate(5deg);
		}

		30% {
			transform: scale(1.15) rotate(-3deg);
		}

		35% {
			transform: scale(1.15) rotate(2deg);
		}

		40% {
			transform: scale(1.15) rotate(0);
		}
	}

	/* 背景波浪高度 */
	.button-number {
		width: 100%;
		height: 150rpx;
		border-radius: 15rpx;
		position: relative;
		z-index: 1;
	}

	/* 动态背景波浪*/
	@keyframes move_wave {
		0% {
			transform: translateX(0) translateZ(0) scaleY(1)
		}

		50% {
			transform: translateX(-25%) translateZ(0) scaleY(1)
		}

		100% {
			transform: translateX(-50%) translateZ(0) scaleY(1)
		}
	}

	.tnwave {
		overflow: hidden;
		position: absolute;
		left: 0;
		right: 0;
		bottom: 0;
		top: 0;
		margin: auto;
		z-index: -1;
		border-radius: 15rpx;
	}

	.waveWrapperInner {
		position: absolute;
		width: 100%;
		overflow: hidden;
		height: 100%;
	}

	.wave {
		position: absolute;
		left: 0;
		width: 200%;
		height: 100%;
		background-repeat: repeat no-repeat;
		background-position: 0 bottom;
		transform-origin: center bottom;
	}

	.bgTop {
		opacity: 0.1;
	}

	.waveTop {
		background-size: 50% 45px;
	}

	.waveAnimation .waveTop {
		animation: move_wave 4s linear infinite;
	}

	.bgMiddle {
		opacity: 0.2;
	}

	.waveMiddle {
		background-size: 50% 40px;
	}

	.waveAnimation .waveMiddle {
		animation: move_wave 3.5s linear infinite;
	}

	.bgBottom {
		opacity: 0.3;
	}

	.waveBottom {
		background-size: 50% 35px;
	}

	.waveAnimation .waveBottom {
		animation: move_wave 2s linear infinite;
	}
</style>